#import "ViewController.h"

@interface ViewController ()<NSTableViewDataSource,NSTableViewDelegate>
@property (weak) IBOutlet NSTextView *textField;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    NSString *urlString = @"startimesApp://Test.Lable?f=1";
    
    NSURL *url = [[NSURL alloc] initWithString:urlString];
    NSLog(@"url: %@", url);
    NSLog(@"path: %@", url.host);
//    NSLog(@"path: %@", );
//    NSLog(@"path: %@", );
//    NSLog(@"path: %@", );
    
    
    
    return;
    
    [self path];
    
    return;
    
    _textField.string = @"fsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdffsdafasdf";
}


- (void)path {
    NSString *index = @"startimesApp://Test.Lable?f=1";
   
    // 获取全名: 名字+扩展名 txt.zip
    NSLog(@"1=%@",[index lastPathComponent]);
    
    // 获取路径: 去掉全名 /Users/test/Desktop/Files
    NSLog(@"2=%@",[index stringByDeletingLastPathComponent]);
    
    // 扩展名 zip
    NSLog(@"3=%@",[index pathExtension]);
    
    // 除扩展名 /Users/test/Desktop/Files/txt
    NSLog(@"4=%@",[index stringByDeletingPathExtension]);
    
    // /Users/test/Desktop/Files/txt.zip
    NSLog(@"5=%@",[index stringByAbbreviatingWithTildeInPath]);
    // 文件名, 除扩展名 txt
    NSLog ( @"9=%@" , [[index lastPathComponent ] stringByDeletingPathExtension ]) ;
    
    NSString * url1 = NSUserName();
    NSString * url2 = NSFullUserName();
    NSString * url3 = NSHomeDirectory();
 
    // vipcode
    NSLog(@"url1: %@", url1);
    // Toj
    NSLog(@"url2: %@", url2);
    // /Users/vipcode
    NSLog(@"url3: %@", url3);
}

@end
